<template>
  <div>
    <h1>动态路由</h1>
    <h1>user:{{userId}}</h1>

  </div>
</template>

<script>
  export default {
    name: 'user',
    data() {
      return {
        userId: null
      }
    },
    created() {
      // 当前页面的参数
      console.log(this.$route);
      const {
        id
      } = this.$route.params
      this.userId = id
    }
  }
</script>

<style>

</style>